package cn.wolfcode.luowowo.search.template;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @author hslef
 */
@Document(indexName="luowowo_hotel",type="hotel")
@Getter
@Setter
public class HotelTemplate implements Serializable {
    public static final String INDEX_NAME = "luowowo_hotel";
    public static final String TYPE_NAME = "hotel";

    //@Field 每个文档的字段配置（类型、是否分词、是否存储、分词器 ）
    @Id
    @Field(store = true, index = true, type = FieldType.Long)
    private Long id;  //酒店id

    @Field(index=true,analyzer="ik_max_word",store=true,searchAnalyzer="ik_max_word",type = FieldType.Text)
    private String name;

    @Field(index=true,store=true,type = FieldType.Keyword)
    private String brand;

    @Field(index=true,analyzer="ik_max_word",store=true,searchAnalyzer="ik_max_word",type = FieldType.Text)
    private String location;

    @Field(index=true,analyzer="ik_max_word",store=true,searchAnalyzer="ik_max_word",type = FieldType.Text)
    private String english;

    @Field(store=true, index = true,type = FieldType.Long)
    private Long destId;

    @Field(index=true,store=true,type = FieldType.Keyword)
    private String destName;

    @Field(index=true,analyzer="ik_max_word",store=true,searchAnalyzer="ik_max_word",type = FieldType.Text)
    private String info;

    @Field(index=true,store=true,type = FieldType.Keyword)
    private List<String> themeName;

    @Field(index=true,store=true,type = FieldType.Keyword)
    private List<String> services;

    @Field(index=true,store=true,type = FieldType.Keyword)
    private List<String> facilities;

    @Field(store=true, index = true,type = FieldType.Long)
    private Long commentNum;

    @Field(store=true, index = true,type = FieldType.Integer)
    private Integer level;

    @Field(store=true, index = true,type = FieldType.Keyword)
    private String typeName;

    @Field(index=true,store=true,type = FieldType.Double)
    private Double minPrice;

    @Field(index=true,store=true,type = FieldType.Keyword)
    private String covUrl;

    @Field(index=true,store=true,type = FieldType.Double)
    private Double commentScore;

}
